# After Defeat: How Governing Parties Respond to Electoral Loss
# Replication files
# Yotam Margalit, Tara Slough, and Michael M. Ting

library("dplyr")
library("ggplot2")
library("lfe")
library("estimatr")
library("starbility")
library("stargazer")
library("mvtnorm")
library("gridExtra")
library("xtable")
library("magrittr")

rm(list = ls())

# Set working directory to replication archive
setwd()


# Main dataset
load("Data/rtl.Rdata")

# Laver-Hunt party organization data from Figure A1.
lh <- read.csv("Data/laver_hunt_party_org.csv")

# Markov chain parameter inputs and output from Mathematica
params <- read.csv(file = "Data/params.csv")
output <- read.csv(file = "Data/simulation_output.csv")

source("03_Main_text_tables_and_figures.R")
source("04_Appendix_tables_and_figures.R")

